package com.spread.controller;

import com.spread.beans.User;
import com.spread.service.UserIService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("demo")
@Api("demo-swagger2")
public class demoController {

    @Autowired
    private UserIService userIService;

    @ApiOperation(value = "登录")
    @RequestMapping(value = "/login", method = RequestMethod.POST)
    public String login (@RequestBody User user) {
        String result = userIService.login(user);
        return result;
    }
}
